package com.tql.mall.model.enums;

public enum OrderStatus {
    UNPAID("未支付"),
    WAIT_DELIVER("待发货"),
    DELIVERED("已发货"),
    WAIT_TAKE("待收货"),
    FINISHED("已签收"),
    CLOSED("已关闭"),
    PAID("已支付"),
    SPLIT("订单已拆分"),
    WAIT_RETURN("待退货"),
    RETURNED("已退货"),
    RETURN_FAIL("退货失败");

    private String comment;

    OrderStatus(String comment) {
        this.comment = comment;
    }

    /**
     * 根据订单状态来获取状态名称
     */
    public static String getStatusNameByStatus(String status) {
        OrderStatus[] arrObj = OrderStatus.values();
        for (OrderStatus obj : arrObj) {
            if (obj.name().equals(status))
                return obj.getComment();
        }
        return "";
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }
}
